﻿@{
    ViewBag.Title = "";
    Layout = "~/Areas/Member/Views/Shared/_form_layout.cshtml";
    List<SelectListItem> listAllAttribute = ViewBag.AllAttribute;
}
<div class="fly-panel fly-panel-user" pad20="">
    <div class="layui-tab layui-tab-brief" lay-filter="user">
        <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding:0px 40px 20px 0;">
            @using (Html.BeginForm(FormMethod.Post, htmlAttributes: new { @class = "layui-form" }))
            {
                @Html.AntiForgeryToken()

                <input type="hidden" name="customFormID" value="@ViewBag.CustomFormID" />
                <input type="hidden" name="empName" value="@ViewBag.EmpName" />
                <input type="hidden" name="startTime" value="@ViewBag.StartTime" />
                <input type="hidden" name="endTime" value="@ViewBag.EndTime" />

                <div class="layui-form-item">
                    <label class="layui-form-label">导出字段</label>
                    <div class="layui-input-block">
                        <input type="checkbox" lay-skin="primary" id="c_all" lay-filter="c_all" title="全部">
                        @foreach (var item in listAllAttribute)
                        {
                            <input type="checkbox" name="fields" lay-skin="primary" class="field" title="@item.Text" value="@item.Value">
                        }
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="submit" value="提 交" class="layui-btn" />
                    </div>
                </div>
            }
        </div>
    </div>
</div>
<script type="text/javascript">

    layui.use(['element', 'form'], function () {
        var form = layui.form;
        var form = layui.form;
        //全选
        form.on('checkbox(c_all)', function (data) {
            var a = data.elem.checked;
            if (a == true) {
                $(".field").prop("checked", true);
                form.render('checkbox');
            } else {
                $(".field").prop("checked", false);
                form.render('checkbox');
            }
        });
    });
     
</script>